<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCompanySearchTable extends Migration{
    /**
     *公司搜索器
     *
     * @return void
     */
    public function up(){
        /** 企业搜索器表 company_search   **/
        Schema::create('company_search', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('uid')->unsigned()->index('uid')->default(0)->comment('所属用户id');
            $table->mediumInteger('jobsort1')->unsigned()->default(0)->comment('工作岗位1');
            $table->mediumInteger('jobsort2')->unsigned()->default(0)->comment('工作岗位2');
            $table->mediumInteger('jobsort3')->unsigned()->default(0)->comment('工作岗位3');
            $table->mediumInteger('jobsort4')->unsigned()->default(0)->comment('工作岗位4');
            $table->mediumInteger('jobsort5')->unsigned()->default(0)->comment('工作岗位5');
            $table->mediumInteger('jobarea1')->unsigned()->default(0)->comment('工作地区1');
            $table->mediumInteger('jobarea2')->unsigned()->default(0)->comment('工作地区2');
            $table->mediumInteger('jobarea3')->unsigned()->default(0)->comment('工作地区3');
            $table->mediumInteger('jobarea4')->unsigned()->default(0)->comment('工作地区4');
            $table->mediumInteger('jobarea5')->unsigned()->default(0)->comment('工作地区5');
            $table->tinyInteger('education')->unsigned()->default(0)->comment('学历');
            $table->tinyInteger('work_year')->unsigned()->default(0)->comment('相关工作经验');
            $table->tinyInteger('age')->unsigned()->default(0)->comment('年龄');
            $table->tinyInteger('sex')->unsigned()->default(0)->comment('性别');
            $table->tinyInteger('chkphoto_open')->unsigned()->default(0)->comment('只显示有相片的简历');
            $table->mediumInteger('homeaddress')->unsigned()->default(0)->comment('现所在地');
            $table->mediumInteger('census')->unsigned()->default(0)->comment('户籍');
            $table->string('keyword', 200)->default('')->comment('关键字');
            $table->mediumInteger('updatetime')->unsigned()->default(0)->comment('更新日期');
            $table->string('search_name', 100)->default('')->comment('搜索器名字');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(){
        Schema::drop('company_search');
    }
}
